# coding:utf-8

move_only = []
park_move = []

rf = open('ymy_specres.dat', 'r')
wf = open('result.dat', 'w')
i = 0
for line in rf.readlines() :
    parts = line.split('\t')
    park_cnt = (int)(parts[0])
    move_cnt = (int)(parts[1])
    success = (float)(parts[2])

    delay = (float)(parts[3])
    quality = (float)(parts[4])
    hops = (float)(parts[5])
    dist = (float)(parts[6])

    adelay = (float)(parts[7])
    aquality = (float)(parts[8])
    ahops = (float)(parts[9])
    adist = (float)(parts[10])

    sdelay = (float)(parts[11])
    squality = (float)(parts[12])
    shops = (float)(parts[13])
    sdist = (float)(parts[14])

    res = {}
    res['park_cnt'] = park_cnt
    res['move_cnt'] = move_cnt
    res['success'] = success
    res['delay'] = delay
    res['quality'] = quality
    res['hops'] = hops
    res['dist'] = dist
    res['adelay'] = adelay
    res['aquality'] = aquality
    res['ahops'] = ahops
    res['adist'] = adist
    res['sdelay'] = sdelay
    res['squality'] = squality
    res['shops'] = shops
    res['sdist'] = sdist

    if i % 2 == 0 :
        move_only.append(res)
    else :
        park_move.append(res)

    i = i + 1


current_park = 0
wf.write("\n!!!MOVE_ONLY DELAY:\n")
for v in move_only :
    if current_park != v['park_cnt']:
        current_park = v['park_cnt']
        wf.write('\nCURRENT_PARK = %d\n' % current_park)
    wf.write("%.3f\n" % v['sdelay'])


current_park = 0
wf.write('\n!!!MOVE_ONLY QUALITY:\n')
for v in move_only :
    if current_park != v['park_cnt']:
        current_park = v['park_cnt']
        wf.write('\nCURRENT_PARK = %d\n' % current_park)
    wf.write("%.3f\n" % v['squality'])

current_park = 0
wf.write('\n!!!MOVE_ONLY HOPS:\n')
for v in move_only :
    if current_park != v['park_cnt']:
        current_park = v['park_cnt']
        wf.write('\nCURRENT_PARK = %d\n' % current_park)
    wf.write("%.3f\n" % v['shops'])

current_park = 0
wf.write('\n!!!MOVE_ONLY DIST:\n')
for v in move_only :
    if current_park != v['park_cnt']:
        current_park = v['park_cnt']
        wf.write('\nCURRENT_PARK = %d\n' % current_park)
    wf.write("%.3f\n" % v['sdist'])

current_park = 0
wf.write('\n!!!MOVE_ONLY SUCCESS:\n')
for v in move_only :
    if current_park != v['park_cnt']:
        current_park = v['park_cnt']
        wf.write('\nCURRENT_PARK = %d\n' % current_park)
    wf.write("%.3f\n" % v['success'])

current_park = 0
wf.write('\n!!!PARK_MOVE DELAY:\n')
for v in park_move :
    if current_park != v['park_cnt']:
        current_park = v['park_cnt']
        wf.write('\nCURRENT_PARK = %d\n' % current_park)
    wf.write("%.3f\n" % v['sdelay'])

current_park = 0
wf.write('\n!!!PARK_MOVE QUALITY:\n')
for v in park_move :
    if current_park != v['park_cnt']:
        current_park = v['park_cnt']
        wf.write('\nCURRENT_PARK = %d\n' % current_park)
    wf.write("%.3f\n" % v['squality'])

current_park = 0
wf.write('\n!!!PARK_MOVE HOPS:\n')
for v in park_move :
    if current_park != v['park_cnt']:
        current_park = v['park_cnt']
        wf.write('\nCURRENT_PARK = %d\n' % current_park)
    wf.write("%.3f\n" % v['shops'])

current_park = 0
wf.write('\n!!!PARK_MOVE SUCCESS:\n')
for v in park_move :
    if current_park != v['park_cnt']:
        current_park = v['park_cnt']
        wf.write('\nCURRENT_PARK = %d\n' % current_park)
    wf.write("%.3f\n" % v['success'])

current_park = 0
wf.write('\n!!!PARK_MOVE DIST:\n')
for v in park_move :
    if current_park != v['park_cnt']:
        current_park = v['park_cnt']
        wf.write('\nCURRENT_PARK = %d\n' % current_park)
    wf.write("%.3f\n" % v['sdist'])